var sdc = require('sdc-clients'),dc_config=require('../config/dc')['poc'],papi = new sdc.PAPI(dc_config.papi)
module.exports = {
	list:function (req, res, next) {
		papi.list({ active: true},{sort: 'name'},function (err, obj) {
			if(err){
				console.log(err)
				if(err.body&&err.body.errors)
					for(var i in err.body.errors)
						console.log(err.body.errors[i])
			}else{
				req.packages=obj
				next()
			}
        })
	}
}